<%@ Page 
  Language="C#" 
  AutoEventWireup="true"  
  CodeFile="DemoCategories.aspx.cs" 
  Inherits="DemoCodeGen.DemoCategories" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Button ID="BtnQuery" runat="Server" OnClick="BtnQuery_Click" />
      
      <asp:GridView 
        ID="grvMaster" 
        runat="server" 
        DataSourceID="dsMaster"
        AllowPaging="true"
        PageSize="3"    
        AutoGenerateColumns="false">    
        <Columns>
          <asp:TemplateField>
            <ItemTemplate>
              <asp:Button ID="tfDelete" Text="Delete" CommandName="Delete" runat="Server" />
            </ItemTemplate>
          </asp:TemplateField>     
          <asp:TemplateField>
            <ItemTemplate>
              <asp:Button ID="tfSelect" Text="Edit" CommandName="Select" runat="Server" />
            </ItemTemplate>
          </asp:TemplateField>               
          <asp:TemplateField HeaderText="CategoryID">
            <ItemTemplate>
              <asp:Label ID="tfCategoryID" Text='<%# Bind("CategoryID") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="CategoryName">
            <ItemTemplate>
              <asp:Label ID="tfCategoryName" Text='<%# Bind("CategoryName") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Description">
            <ItemTemplate>
              <asp:Label ID="tfDescription" Text='<%# Bind("Description") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Picture">
            <ItemTemplate>
              <asp:Label ID="tfPicture" Text='<%# Bind("Picture") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
        </Columns>
      </asp:GridView>
      
      <asp:ObjectDataSource 
        ID="dsMaster" 
        runat="server" 
        TypeName="DemoCodeGen.BLLCategories" 
        DataObjectTypeName="DemoCodeGen.Categories"
        SelectMethod="SelectPaging" 
        DeleteMethod="Delete"
        SelectCountMethod="SelectCount" 
        EnablePaging="True"
        OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
          <asp:Parameter Name="startRowIndex" Type="Int32" />
          <asp:Parameter Name="maximumRows" Type="Int32" />
        </SelectParameters>
      </asp:ObjectDataSource>   
    </div>
    </form>
</body>
</html>
